package com.atzzy.ysmall.ysmall_userserviceimpl;

import com.alibaba.dubbo.config.annotation.Service;
import com.atzzy.ysmall.ysmall_allService.UserService.UserAddrService;
import com.atzzy.ysmall.ysmall_beans.UserAddr;
import com.atzzy.ysmall.ysmall_common.vo.R;
import com.atzzy.ysmall.ysmall_mapper.UserAddrMapper;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author JAVAZeng
 * @Date 2022/4/4 14:03
 * @Version 1.0
 */
@Service
@Component
public class UserAddrServiceImpl implements UserAddrService {

    @Resource
    private UserAddrMapper userAddrMapper;

    @Override
    public R listAddrsByUid(int userId) {
        List<UserAddr> userAddrs = userAddrMapper.selectUserAddr(userId);
        if(userAddrs!=null)
        {
            return new R(201,"success",userAddrs);
        }
        return new R(501,"fail",null);
    }
}
